# f = open("D:\\temp\\foo1.txt",'w')
# f.write("Python是一个非常好的语言。\n是的，的确非常好！！\n")

# f.close()

# f = open("D:\\temp\\foo.txt",'rb+')

# str = f.read()
# print(str)
# num = f.write(b'0123456789abcdef')
# print(num)

# f.seek(5)
# print(f.read(1))

# f.seek(-3,2)
# print(f.read(1))

# f.close()

import pickle,pprint

# data1 = {'a':[1,2.0,3,4+6j],'b':('string',u'Unicode string'),'c':None}

# selfref_list = [1,2,3]
# selfref_list.append(selfref_list)

# output = open("D:\\temp\\data.pk1",'wb')

# pickle.dump(data1,output)

# pickle.dump(selfref_list,output,-1)

# output.close()
pk1_file = open("D:\\temp\\data.pk1",'rb')

data1 = pickle.load(pk1_file)
pprint.pprint(data1)

data2 = pickle.load(pk1_file)
pprint.pprint(data2)

pk1_file.close()